package com.twohand.admin.Mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.twohand.admin.Entity.Bill;
import com.twohand.admin.Vo.BillDetailOrderVo;
import com.twohand.admin.Vo.BillSearchResult;
import com.twohand.admin.Vo.Order.OrderStatisVo;
import com.twohand.admin.Vo.SelectOptions;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface BillMapper extends BaseMapper<Bill> {
    @Select("select bill_no as value,bill_no as label from bill")
    List<SelectOptions> getOptions();

//    @Select("select bill.*,salesman.name from bill LEFT JOIN salesman ON salesman.id = bill.sid")
//    List<Bill> getList();

    List<Bill> getList(String billNo,String status,String activeDate,String shopName,Integer platform,String startTime,String endTime,List<Integer> shopIds);
    List<BillSearchResult> getBillDetailList(String shopName,String activeDate,Integer status,List<String> billNoList);
    List<BillSearchResult> getBillDetailListById(Integer id,String activeDate,Integer status,List<String> billNoList);
    BillDetailOrderVo getBillDetailOrder(String billNo);
    OrderStatisVo orderMoneyTotal(String billNo,String status,String activeDate,String shopName,Integer platform,String startTime,String endTime,List<Integer> shopIds);

    Integer batchChangeStatus(List<String> ids, Integer status);
    List<String> groupActiveDate(List<Integer> shopIds,Integer status);

    Integer batchChangeShop(List<String> ids, Integer shopId);

    List<BillSearchResult> getBillDetailListByRelevancy(String relevancy,String activeDate,Integer status,List<String> billNoList);
}
